package com.redsoil.house.ui.property.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.redsoil.house.R;
import com.redsoil.house.base.BaseViewHolderTSK;
import com.redsoil.house.model.bean.OnePropertyVO;

import java.util.List;

/**
 * Created by weidingqiang on 2018/12/18.
 */

public class PropertyLeaseAdapter extends BaseQuickAdapter<OnePropertyVO.RoomsBean,BaseViewHolderTSK> {

    public PropertyLeaseAdapter(int layoutResId, List<OnePropertyVO.RoomsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolderTSK helper, OnePropertyVO.RoomsBean item) {
        //"state"  //房间状态：状态：0删除/1空房/2租赁中/3装修中
        helper.setText(R.id.room_number_tv,item.getRoomNum());
        helper.setVisible(R.id.red_arrow_img, false);

        switch (item.getState()){
            case "0":
                break;
            case "1":
                helper.setText(R.id.room_state_tv,"空房");
                break;
            case "2":
                helper.setText(R.id.room_state_tv,"租赁中");
                helper.setVisible(R.id.red_arrow_img, true);
                break;
            case "3":
                helper.setText(R.id.room_state_tv,"装修中");
                break;
        }

    }
}
